@echo off
color 0a
echo Flight simulator
pause

:loop
cls
:start
color 0a
echo BatchFlyte v0.0.1
echo Please select input.
echo 1. Begin game
echo 2. Options
echo 3. Credits
set /p menuinput=

if not defined menuinput
(
goto loop
)

if %menuinput% == 1 goto launchgame
if %menuinput% == 2 goto options
if %menuinput% == 3 goto credits

:begingame
cls
echo Enter flight name.
set /p flightname=
echo set flightname= %flightname% >> flightlog.bat
echo Set call sign (all caps, alpha numeric, 7 chars)
set /p call=
echo set call= %call% >> flightlog.bat
echo Press x to init.
set /p begin:

echo Initialized at %time% on %date% >> flightlog.bat

if %begin% == x goto init
else exit

:init
cls
set init= yes
set alt= 00000
set x= 000
set y= 000
set z= 000
set axlrotone= 000
set axlrottwo= 000
set axlrotthree= 000
call :startengine
call :view
pause
goto inflight

:inflight
cls
call :simulate
call :view
call :input
echo debug initialized >> debug.dat
if exist debug.dat
(
call :input
)
else
(
cls
echo Write failed. Initializing debug...
pause
debug.bat
exit
)


:view
cls
SET ENABLED DELAYEDEXPANSIONS
echo %lineone%
echo %linetwo%
echo %linethree%
echo %linefive%
echo %linesix%
echo %lineseven% 
echo %linenine%
echo %lineten%
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo Í     #####                  ######################    Í
echo Í     #%speed%#              #%altitude%          #    Í
echo Í     #####                  ######################    Í
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo view init successful >> log.bat
"log.bat" attrib +h -s

:simulate
if axlrotone LsS 001
(
if axlrottwo LSS 001
(
if axlrotthree LSS 001
(
set status = grounded
)
)
)

else
(
set status = airborne
)

if axlrotone + axlrottwo + axlrotthree GTR 1080 
(
cls
echo Axial simulation failure. Max rotation measure exceeded.
echo Error code: L'Amour.
echo set axial_failure= yes >> log.bat
pause
log.bat
goto debug
)

else
(
echo No errors found. >> log.bat
)

:debug
cls
echo Initializing debug...
pause
log.bat
if %axialfailure% == yes
(
echo Clientside error.
echo Error code: Orwell.
pause
goto exit
)

if exist log.bat
(
echo Unknown error.
echo Error code: Tolkein.
pause
goto exit
)

else
(
echo fileIO error.
echo log.bat does not exist.
echo Please run BatchFlyte as an administer.
echo Error code: Rowling.
pause
goto fileIO
)

:input
cls
if status = grounded call groundphysics
if status = airborne call airphysics
else
(
echo An physics error has occured.
echo Airborne/ground not defined.
echo Error code: Shakespeare.
pause
exit
)

:groundphysics
cls
if %status% == grounded
(
set /p axlinput= W for down, S for up, a for lean left, d for lean right.
if %axlinput% == w goto adjaxlonedown
if %axlinput% == s goto adjaxloneup
if %axlinput% == a goto adjaxltwoleft
if %axlinput% == d goto adjaxltworight
if %axlinput% == q goto adjaxlthreerudderleft
if %axlinput% == e goto adjaxlthreerudderright
else
(
cls
echo Error: Input failure.
echo Error code: Asimov.
pause
goto exit
)

else
(
cls
echo You have reached this page in error.
echo Error code: Pilkey.
pause 
exit
)

:















































